

#import "XTXChatCell.h"
#import "SDAutoLayout.h"

@implementation XTXChatCell

-(UILabel *)liaotianLabel{
    if (!_liaotianLabel) {
        _liaotianLabel = [UILabel new];
        _liaotianLabel.font = [UIFont systemFontOfSize:iOS_frame_width(30)];
        _liaotianLabel.textAlignment = NSTextAlignmentLeft;
        _liaotianLabel.numberOfLines = 0;
        _liaotianLabel.textColor = [UIColor whiteColor];
    }
    return _liaotianLabel;
}

-(UIView *)bgView{
    if (!_bgView) {
        _bgView = [UIView new];
        _bgView.backgroundColor = XZRGB(0x9576e4);
        
        
    }
    return _bgView;
}

-(UILabel *)liaotianLabelTime{
    if (!_liaotianLabelTime) {
        _liaotianLabelTime = [UILabel new];
        _liaotianLabelTime.textColor = XZColor(105,105,105);
        _liaotianLabelTime.textAlignment = NSTextAlignmentCenter;
        _liaotianLabelTime.font = [UIFont systemFontOfSize:iOS_frame_width(22)];
    }
    return _liaotianLabelTime;
}


-(UIImageView *)xitongImageView{
    if (!_xitongImageView) {
        _xitongImageView = [[UIImageView alloc]init];

    }
    return _xitongImageView;
}

-(UIImageView *)xitongImageView02{
    if (!_xitongImageView02) {
        _xitongImageView02 = [[UIImageView alloc]init];
        _xitongImageView02.layer.masksToBounds = YES;
        _xitongImageView02.layer.cornerRadius = 20;
        [_xitongImageView02 setContentScaleFactor:[[UIScreen mainScreen] scale]];
        _xitongImageView02.contentMode =  UIViewContentModeScaleAspectFill;
        _xitongImageView02.autoresizingMask = UIViewAutoresizingFlexibleHeight;
        _xitongImageView02.clipsToBounds  = YES;
    }
    return _xitongImageView02;
}

-(void)layoutSuoyouView{
    _liaotianLabelTime.sd_layout.topSpaceToView(self.contentView, iOS_frame_height(40)).rightSpaceToView(self.contentView, 0).leftSpaceToView(self.contentView, 0).heightIs(iOS_frame_height(22));
    
}

-(void)laodSuoyouView{
    [self.contentView addSubview:self.liaotianLabelTime];
    [self.contentView addSubview:self.xitongImageView02];
    [self.contentView addSubview:self.xitongImageView];
    [self.contentView addSubview:self.bgView];
    [self.bgView addSubview:self.liaotianLabel];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self laodSuoyouView];
        [self layoutSuoyouView];
    }
    return self;
}

@end
